<template>
	<view>
		<view v-for="(item,index) in list" :key="index" class="list u-flex" @click="go(item)">

			<u-image :src="item.goods[0].cover" width="250" height="250" border-radius="20"></u-image>

			<view class="u-margin-left-20">
				<view style="color: #A66D00;font-size: 32rpx;">
					{{item.goods[0].name}}
				</view>

				<view style="color: #FF6450;font-size: 28rpx;margin: 40rpx 0;">价值{{item.goods[0].price}}元</view>

				<view class="time">
					{{item.createTime}}拿到
				</view>

			</view>


		</view>
		<u-loadmore :status="status" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],

				page: 1,

				status: 'loadmore',

			}
		},
		onLoad() {
			this.jiazai()
		},
		onReachBottom() {
			if (this.status == 'nomore') {

			} else {
				this.getGoods()
			}

		},

		methods: {
			go(item){
				uni.navigateTo({
					url:"./success?id="+item.id
				})
			},
			jiazai() {
				this.$u.post('/api/Indent/hew', {

					type: 1,
					page: this.page,
				}, {}).then(res => {

					var resList = res.data;
					if (this.page == 1) {
						this.list = []
					}
					if (resList.length > 9) {
						this.status = 'loadmore'
						this.page = this.page + 1
					} else {
						this.status = 'nomore'
					}
					this.list = this.list.concat(resList)
					this.loading = false

				}).catch(err => {})
			}



		}
	}
</script>

<style>
	page {

		width: 100%;
		height: 100vh;

			background: #FB5E3F;
		display: inline-block;
	}
	.list{
		background: #FFFFFF;
		width: 690rpx;
		margin: 20rpx auto;
		padding: 20rpx;
		border-radius: 20rpx;
	}
</style>
